// pages/type/type.js
import {get} from "../../utils/db";

Page({

  /**
   * 页面的初始数据
   */
  data: {
    types: []
  },
  async onLoad() {
    let openid = wx.getStorageSync('openid')
    let result = await get({ collection: "type"}).catch(err => {
      console.log(err)
    })
    // console.log(result.data)
    this.setData({
      types: result.data
    })
  },
  //跳转列表页
  toList(){
    wx.navigateTo({
      url: '/pages/list/list',
    })
  }


})